package com.yingside.jdk8new;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class TestStream {
    public static void main(String[] args) {
        List<String> list = new ArrayList<String>();

        list.add("张三");
        list.add("张三");
        list.add("李四");
        list.add("王五");

        long count = list.stream().distinct().count();
        System.out.println(count);

        Stream<String> s = list.stream().filter(e -> {
            return e.contains("三");
        });

        //s.forEach(e -> System.out.println(e));

        s.forEach(System.out::println);

    }
}
